<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Priithon.ArrayIO</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Priithon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/priithon">Priithon</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="Priithon-module.html">Package&nbsp;Priithon</a> ::
        Module&nbsp;ArrayIO
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="Priithon.ArrayIO-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="Priithon.ArrayIO-module.html">Module Priithon.ArrayIO</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># Array I/O to text files</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"># seb changed Numeric to numarray - 2003-Apr-07</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># seb changed numarray to numpy  - 2006-Jul-22</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"># Written by Konrad Hinsen &lt;hinsen@cnrs-orleans.fr&gt;</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># last revision: 2001-12-5</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-docstring">"""This module contains elementary support for I/O of one- and</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-docstring">two-dimensional numerical arrays to and from plain text files. The</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-docstring">text file format is very simple and used by many other programs as</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-docstring">well:</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring">- each line corresponds to one row of the array</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">- the numbers within a line are separated by white space</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">- lines starting with # are ignored (comment lines)</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">An array containing only one line or one column is returned as a</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">one-dimensional array on reading. One-dimensional arrays are written</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">as one item per line.</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">Numbers in files to be read must conform to Python/C syntax.  For</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">reading files containing Fortran-style double-precision numbers</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">(exponent prefixed by D), use the module Scientific.IO.FortranFormat.</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">__future__</tt> <tt class="py-keyword">import</tt> <tt class="py-name">absolute_import</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-comment">#from Scientific.IO.TextFile import TextFile</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">from</tt> <tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Module Priithon.Scientific_IO_TextFile=Priithon.Scientific_IO_TextFile-module.html"><a title="Priithon.Scientific_IO_TextFile" class="py-name" href="#" onclick="return doclink('link-0', 'Scientific_IO_TextFile', 'link-0');">Scientific_IO_TextFile</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class Priithon.Scientific_IO_TextFile.TextFile=Priithon.Scientific_IO_TextFile.TextFile-class.html"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-1', 'TextFile', 'link-1');">TextFile</a></tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Module Priithon.string=Priithon.string-module.html"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-2', 'string', 'link-2');">string</a></tt><tt class="py-op">,</tt> <tt class="py-name">numpy</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"> </tt>
<a name="readArray"></a><div id="readArray-def"><a name="L37"></a><tt class="py-lineno"> 37</tt> <a class="py-toggle" href="#" id="readArray-toggle" onclick="return toggle('readArray');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.ArrayIO-module.html#readArray">readArray</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">comment</tt><tt class="py-op">=</tt><tt class="py-string">'#'</tt><tt class="py-op">,</tt> <tt class="py-param">sep</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="readArray-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="readArray-expanded"><a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">    <tt class="py-docstring">"""Return an array containing the data from file |filename|. This</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring">    function works for arbitrary data types (every array element can be</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    given by an arbitrary Python expression), but at the price of being</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">    slow. For large arrays, use readFloatArray or readIntegerArray</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    if possible.</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">    ignore all lines that start with any character contained in comment</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">    <tt id="link-3" class="py-name" targets="Variable Priithon.viewerRubberbandMode.viewerRubberbandMode.data=Priithon.viewerRubberbandMode.viewerRubberbandMode-class.html#data"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-3', 'data', 'link-3');">data</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt id="link-4" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-4', 'TextFile', 'link-1');">TextFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-keyword">in</tt> <tt class="py-name">comment</tt><tt class="py-op">:</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">            <tt id="link-5" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-5', 'data', 'link-3');">data</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">eval</tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-6', 'string', 'link-2');">string</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">,</tt> <tt class="py-name">sep</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">    <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt id="link-7" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-7', 'data', 'link-3');">data</a></tt><tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Variable Priithon.mockNDarray.mockNDarray.shape=Priithon.mockNDarray.mockNDarray-class.html#shape"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-8', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt> <tt class="py-keyword">or</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-9', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">ravel</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">a</tt> </tt>
</div><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"> </tt>
<a name="readArray_conv"></a><div id="readArray_conv-def"><a name="L55"></a><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="readArray_conv-toggle" onclick="return toggle('readArray_conv');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.ArrayIO-module.html#readArray_conv">readArray_conv</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">fn</tt><tt class="py-op">,</tt> <tt class="py-param">comment</tt><tt class="py-op">=</tt><tt class="py-string">'#'</tt><tt class="py-op">,</tt> <tt class="py-param">dtype</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">sep</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="readArray_conv-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="readArray_conv-expanded"><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"><tt class="py-docstring">    Return an array containing the data from file |filename|. This</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt class="py-docstring">    function works for arbitrary data types (every array element can be</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt class="py-docstring">    given by an arbitrary Python expression), but at the price of being</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt class="py-docstring">    slow. </tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">   </tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">    fn is called for each "cell" value.</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring">    if dtype is None, uses "minimum type" (ref. Numpy doc)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">    if sep is None, any white space is seen as field separator</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">    ignore all lines that start with any character contained in comment</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">    <tt id="link-10" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-10', 'data', 'link-3');">data</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt id="link-11" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-11', 'TextFile', 'link-1');">TextFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-keyword">in</tt> <tt class="py-name">comment</tt><tt class="py-op">:</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">            <tt id="link-12" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-12', 'data', 'link-3');">data</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">fn</tt><tt class="py-op">,</tt> <tt id="link-13" class="py-name"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-13', 'string', 'link-2');">string</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">,</tt> <tt class="py-name">sep</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">    <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt id="link-14" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-14', 'data', 'link-3');">data</a></tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-15', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt> <tt class="py-keyword">or</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-16', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">ravel</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">a</tt> </tt>
</div><a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="readFloatArray"></a><div id="readFloatArray-def"><a name="L76"></a><tt class="py-lineno"> 76</tt> <a class="py-toggle" href="#" id="readFloatArray-toggle" onclick="return toggle('readFloatArray');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.ArrayIO-module.html#readFloatArray">readFloatArray</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">,</tt> <tt class="py-param">sep</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment">## seb added type argument</tt> </tt>
</div><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">    <tt class="py-docstring">"Return a floating-point array containing the data from file |filename|."</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">    <tt id="link-17" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-17', 'data', 'link-3');">data</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt id="link-18" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-18', 'TextFile', 'link-1');">TextFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-string">'#'</tt><tt class="py-op">:</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">            <tt id="link-19" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-19', 'data', 'link-3');">data</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-20" class="py-name"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-20', 'string', 'link-2');">string</a></tt><tt class="py-op">.</tt><tt class="py-name">atof</tt><tt class="py-op">,</tt> <tt id="link-21" class="py-name"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-21', 'string', 'link-2');">string</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">,</tt> <tt class="py-name">sep</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">    <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt id="link-22" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-22', 'data', 'link-3');">data</a></tt><tt class="py-op">,</tt> <tt id="link-23" class="py-name" targets="Variable Priithon.mockNDarray.mockNDarray.dtype=Priithon.mockNDarray.mockNDarray-class.html#dtype"><a title="Priithon.mockNDarray.mockNDarray.dtype" class="py-name" href="#" onclick="return doclink('link-23', 'dtype', 'link-23');">dtype</a></tt><tt class="py-op">=</tt><tt id="link-24" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.dtype" class="py-name" href="#" onclick="return doclink('link-24', 'dtype', 'link-23');">dtype</a></tt><tt class="py-op">)</tt> <tt class="py-comment">## seb added type argument</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-25', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt> <tt class="py-keyword">or</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-26', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">ravel</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">a</tt> </tt>
</div><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"> </tt>
<a name="readIntegerArray"></a><div id="readIntegerArray-def"><a name="L87"></a><tt class="py-lineno"> 87</tt> <a class="py-toggle" href="#" id="readIntegerArray-toggle" onclick="return toggle('readIntegerArray');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.ArrayIO-module.html#readIntegerArray">readIntegerArray</a><tt class="py-op">(</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">int32</tt><tt class="py-op">,</tt> <tt class="py-param">sep</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment">## seb added type argument</tt> </tt>
</div><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">    <tt class="py-docstring">"Return an integer array containing the data from file |filename|."</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">    <tt id="link-27" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-27', 'data', 'link-3');">data</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt id="link-28" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-28', 'TextFile', 'link-1');">TextFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">!=</tt> <tt class="py-string">'#'</tt><tt class="py-op">:</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">            <tt id="link-29" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-29', 'data', 'link-3');">data</a></tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-30" class="py-name"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-30', 'string', 'link-2');">string</a></tt><tt class="py-op">.</tt><tt class="py-name">atoi</tt><tt class="py-op">,</tt> <tt id="link-31" class="py-name"><a title="Priithon.string" class="py-name" href="#" onclick="return doclink('link-31', 'string', 'link-2');">string</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-name">line</tt><tt class="py-op">,</tt> <tt class="py-name">sep</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">    <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt id="link-32" class="py-name"><a title="Priithon.viewerRubberbandMode.viewerRubberbandMode.data" class="py-name" href="#" onclick="return doclink('link-32', 'data', 'link-3');">data</a></tt><tt class="py-op">,</tt> <tt id="link-33" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.dtype" class="py-name" href="#" onclick="return doclink('link-33', 'dtype', 'link-23');">dtype</a></tt><tt class="py-op">=</tt><tt id="link-34" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.dtype" class="py-name" href="#" onclick="return doclink('link-34', 'dtype', 'link-23');">dtype</a></tt><tt class="py-op">)</tt> <tt class="py-comment">## seb added type argument</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-35', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt> <tt class="py-keyword">or</tt> <tt class="py-name">a</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-36', 'shape', 'link-8');">shape</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">ravel</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">a</tt> </tt>
</div><a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"> </tt>
<a name="writeArray"></a><div id="writeArray-def"><a name="L98"></a><tt class="py-lineno"> 98</tt> <a class="py-toggle" href="#" id="writeArray-toggle" onclick="return toggle('writeArray');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.ArrayIO-module.html#writeArray">writeArray</a><tt class="py-op">(</tt><tt class="py-param">array</tt><tt class="py-op">,</tt> <tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">mode</tt><tt class="py-op">=</tt><tt class="py-string">'w'</tt><tt class="py-op">,</tt> <tt class="py-param">sep</tt><tt class="py-op">=</tt><tt class="py-string">' '</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="writeArray-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="writeArray-expanded"><a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">    <tt class="py-docstring">"""Write array |a| to file |filename|. |mode| can be 'w' (new file)</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-docstring">       or 'a' (append)."""</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">    <tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt id="link-37" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-37', 'TextFile', 'link-1');">TextFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt> <tt class="py-name">mode</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">array</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-38', 'shape', 'link-8');">shape</a></tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-name">array</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name" targets="Variable Priithon.mandel.newaxis=Priithon.mandel-module.html#newaxis,Variable Priithon.plt.interface.newaxis=Priithon.plt.interface-module.html#newaxis,Variable Priithon.plt.newaxis=Priithon.plt-module.html#newaxis,Variable Priithon.plt.plot_objects.newaxis=Priithon.plt.plot_objects-module.html#newaxis,Variable Priithon.plt.plot_utility.newaxis=Priithon.plt.plot_utility-module.html#newaxis,Variable Priithon.plt.wxplt.newaxis=Priithon.plt.wxplt-module.html#newaxis"><a title="Priithon.mandel.newaxis
Priithon.plt.interface.newaxis
Priithon.plt.newaxis
Priithon.plt.plot_objects.newaxis
Priithon.plt.plot_utility.newaxis
Priithon.plt.wxplt.newaxis" class="py-name" href="#" onclick="return doclink('link-39', 'newaxis', 'link-39');">newaxis</a></tt><tt class="py-op">]</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">array</tt><tt class="py-op">:</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">element</tt> <tt class="py-keyword">in</tt> <tt class="py-name">line</tt><tt class="py-op">:</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">            <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name" targets="Method Priithon.Scientific_IO_TextFile.TextFile.write()=Priithon.Scientific_IO_TextFile.TextFile-class.html#write,Method Priithon.py.document.Document.write()=Priithon.py.document.Document-class.html#write,Method Priithon.py.editwindow.EditWindow.write()=Priithon.py.editwindow.EditWindow-class.html#write,Method Priithon.py.pseudo.PseudoFile.write()=Priithon.py.pseudo.PseudoFile-class.html#write,Method Priithon.py.shell.Shell.write()=Priithon.py.shell.Shell-class.html#write"><a title="Priithon.Scientific_IO_TextFile.TextFile.write
Priithon.py.document.Document.write
Priithon.py.editwindow.EditWindow.write
Priithon.py.pseudo.PseudoFile.write
Priithon.py.shell.Shell.write" class="py-name" href="#" onclick="return doclink('link-40', 'write', 'link-40');">write</a></tt><tt class="py-op">(</tt><tt class="py-op">`</tt><tt class="py-name">element</tt><tt class="py-op">`</tt> <tt class="py-op">+</tt> <tt class="py-name">sep</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile.write
Priithon.py.document.Document.write
Priithon.py.editwindow.EditWindow.write
Priithon.py.pseudo.PseudoFile.write
Priithon.py.shell.Shell.write" class="py-name" href="#" onclick="return doclink('link-41', 'write', 'link-40');">write</a></tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">    <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name" targets="Method Priithon.Mrc.Mrc.close()=Priithon.Mrc.Mrc-class.html#close,Method Priithon.Mrc.Mrc2.close()=Priithon.Mrc.Mrc2-class.html#close,Method Priithon.Scientific_IO_TextFile.TextFile.close()=Priithon.Scientific_IO_TextFile.TextFile-class.html#close,Method Priithon.plt.dumbdbm_patched._Database.close()=Priithon.plt.dumbdbm_patched._Database-class.html#close,Function Priithon.plt.interface.close()=Priithon.plt.interface-module.html#close,Method Priithon.readerSPE.File.close()=Priithon.readerSPE.File-class.html#close"><a title="Priithon.Mrc.Mrc.close
Priithon.Mrc.Mrc2.close
Priithon.Scientific_IO_TextFile.TextFile.close
Priithon.plt.dumbdbm_patched._Database.close
Priithon.plt.interface.close
Priithon.readerSPE.File.close" class="py-name" href="#" onclick="return doclink('link-42', 'close', 'link-42');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Write several data sets (one point per line) to a text file,</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># with a separator line between data sets. This is sufficient</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># to make input files for most plotting programs.</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="writeDataSets"></a><div id="writeDataSets-def"><a name="L115"></a><tt class="py-lineno">115</tt> <a class="py-toggle" href="#" id="writeDataSets-toggle" onclick="return toggle('writeDataSets');">-</a><tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">def</tt> <a class="py-def-name" href="Priithon.ArrayIO-module.html#writeDataSets">writeDataSets</a><tt class="py-op">(</tt><tt class="py-param">datasets</tt><tt class="py-op">,</tt> <tt class="py-param">filename</tt><tt class="py-op">,</tt> <tt class="py-param">separator</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="writeDataSets-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="writeDataSets-expanded"><a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">    <tt class="py-docstring">"""Write each of the items in the sequence |datasets|</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"><tt class="py-docstring">    to the file |filename|, separating the datasets by a line</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"><tt class="py-docstring">    containing |separator|. The items in the data sets can be</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line"><tt class="py-docstring">    one- or two-dimensional arrays or equivalent nested sequences.</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"><tt class="py-docstring">    The output file format is understood by many plot programs.</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">    <tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt id="link-43" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile" class="py-name" href="#" onclick="return doclink('link-43', 'TextFile', 'link-1');">TextFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt> <tt class="py-string">'w'</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">    <tt class="py-name">nsets</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">datasets</tt><tt class="py-op">)</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt id="link-44" class="py-name" targets="Variable Priithon.viewer.i=Priithon.viewer-module.html#i,Variable Priithon.viewer2.i=Priithon.viewer2-module.html#i,Variable Priithon.viewerCommon.i=Priithon.viewerCommon-module.html#i"><a title="Priithon.viewer.i
Priithon.viewer2.i
Priithon.viewerCommon.i" class="py-name" href="#" onclick="return doclink('link-44', 'i', 'link-44');">i</a></tt> <tt class="py-keyword">in</tt> <tt id="link-45" class="py-name" targets="Method Priithon.plt.plot_objects.axis_object.range()=Priithon.plt.plot_objects.axis_object-class.html#range"><a title="Priithon.plt.plot_objects.axis_object.range" class="py-name" href="#" onclick="return doclink('link-45', 'range', 'link-45');">range</a></tt><tt class="py-op">(</tt><tt class="py-name">nsets</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">datasets</tt><tt class="py-op">[</tt><tt id="link-46" class="py-name"><a title="Priithon.viewer.i
Priithon.viewer2.i
Priithon.viewerCommon.i" class="py-name" href="#" onclick="return doclink('link-46', 'i', 'link-44');">i</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="Priithon.mockNDarray.mockNDarray.shape" class="py-name" href="#" onclick="return doclink('link-47', 'shape', 'link-8');">shape</a></tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">            <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">d</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="Priithon.mandel.newaxis
Priithon.plt.interface.newaxis
Priithon.plt.newaxis
Priithon.plt.plot_objects.newaxis
Priithon.plt.plot_utility.newaxis
Priithon.plt.wxplt.newaxis" class="py-name" href="#" onclick="return doclink('link-48', 'newaxis', 'link-39');">newaxis</a></tt><tt class="py-op">]</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">point</tt> <tt class="py-keyword">in</tt> <tt class="py-name">d</tt><tt class="py-op">:</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">number</tt> <tt class="py-keyword">in</tt> <tt class="py-name">point</tt><tt class="py-op">:</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">                <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile.write
Priithon.py.document.Document.write
Priithon.py.editwindow.EditWindow.write
Priithon.py.pseudo.PseudoFile.write
Priithon.py.shell.Shell.write" class="py-name" href="#" onclick="return doclink('link-49', 'write', 'link-40');">write</a></tt><tt class="py-op">(</tt><tt class="py-op">`</tt><tt class="py-name">number</tt><tt class="py-op">`</tt> <tt class="py-op">+</tt> <tt class="py-string">' '</tt><tt class="py-op">)</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">            <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-50" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile.write
Priithon.py.document.Document.write
Priithon.py.editwindow.EditWindow.write
Priithon.py.pseudo.PseudoFile.write
Priithon.py.shell.Shell.write" class="py-name" href="#" onclick="return doclink('link-50', 'write', 'link-40');">write</a></tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt id="link-51" class="py-name"><a title="Priithon.viewer.i
Priithon.viewer2.i
Priithon.viewerCommon.i" class="py-name" href="#" onclick="return doclink('link-51', 'i', 'link-44');">i</a></tt> <tt class="py-op">&lt;</tt> <tt class="py-name">nsets</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">            <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="Priithon.Scientific_IO_TextFile.TextFile.write
Priithon.py.document.Document.write
Priithon.py.editwindow.EditWindow.write
Priithon.py.pseudo.PseudoFile.write
Priithon.py.shell.Shell.write" class="py-name" href="#" onclick="return doclink('link-52', 'write', 'link-40');">write</a></tt><tt class="py-op">(</tt><tt class="py-name">separator</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">    <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-53" class="py-name"><a title="Priithon.Mrc.Mrc.close
Priithon.Mrc.Mrc2.close
Priithon.Scientific_IO_TextFile.TextFile.close
Priithon.plt.dumbdbm_patched._Database.close
Priithon.plt.interface.close
Priithon.readerSPE.File.close" class="py-name" href="#" onclick="return doclink('link-53', 'close', 'link-42');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Priithon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/priithon">Priithon</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Nov 22 14:59:48 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
